﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FunPokerMakerOnline.Business
{
    //TODO commentary
    /// <summary>
    /// This class represent a card game.
    /// </summary>
    public class Game
    {
        int _Id = 0;
        string _Name = null;
        int _MinimumOfPlayer;
        int _MaximumPlayer;
        List<Card> _ListOfCardToPlay;
        List<GameActionType> _SequenceOfGame;


        public Game()
        {
            //TODO place the COnstructor to DB
            this._Id = 1;
            this._Name = "Texas Holdem";
            this._MaximumPlayer = 10;
            this._MinimumOfPlayer = 2;
            this._ListOfCardToPlay = GetCards(this._Id);
            this._SequenceOfGame = GetGameSequence(this._Id);

        }

        private List<GameActionType> GetGameSequence(int GameId)
        {
            //TODO implements
            throw new NotImplementedException();
        }

        private List<Card> GetCards(int GameId)
        {
            //TODO Go To BD for this data
            List<Card> GameCards = new List<Card>();
            for (int y = 1; y < 5; y++)
            {
                Kind myKind = new Kind();
                switch (y)
                {
                    case (int)Kind.Hearts:
                        {
                            myKind = Kind.Hearts ;
                            break;
                        }
                    case (int)Kind.Spades:
                        {
                            myKind = Kind.Spades;
                            break;
                        }
                  case (int)Kind.Diamonds:
                        {
                            myKind = Kind.Diamonds;
                            break;
                        }
                  case (int)Kind.Clubs:
                        {
                            myKind = Kind.Clubs;
                            break;
                        }

                }
                for (int i = 1; i < 14; i++)
                {
                    Card MyCard = new Card(myKind, i);
                    GameCards.Add(MyCard);
                }
            }

            return GameCards;
        }
    }
}
